Fix the 64-bit build.
Signed-off-by: Keir Fraser <keir@xensource.com>
3ddb79c1W0lQca8gRV7sN6j3iY4Luw xen/include/xen/event.h
41262590CyJy4vd42dnqzsn8-eeGvw xen/include/xen/grant_table.h
3ddb79c0GurNF9tDWqQbAwJFH8ugfA xen/include/xen/init.h
+428084e41zemtCAtYLcD9bUzwE35SA xen/include/xen/inttypes.h
3ddb79c1nzaWu8NoF4xCCMSFJR4MlA xen/include/xen/ioport.h
3ddb79c2qAxCOABlkKtD8Txohe-qEw xen/include/xen/irq.h
3ddb79c2b3qe-6Ann09FqZBF4IrJaQ xen/include/xen/irq_cpustat.h
static inline void acpi_madt_oem_check(char *oem_id, char *oem_table_id) { }
extern void __init clustered_apic_check(void);
static inline int ioapic_setup_disabled(void) { return 0; }
-#include <asm/proto.h>
#else /* X86 */
if (!phys_addr || !size)
return NULL;
- if (phys_addr < (end_pfn_map << PAGE_SHIFT))
+ if (phys_addr < (max_page << PAGE_SHIFT))
return __va(phys_addr);
return NULL;
mapped_size += PAGE_SIZE;
}
- return ((unsigned char *) base + offset);
+ return ((char *) base + offset);
}
#endif
struct exec_domain *ed = current;
struct domain *d = ed->domain;
u32 type_info;
- struct map_dom_mem_cache mapcache = MAP_DOM_MEM_CACHE_INIT;
- struct map_dom_mem_cache sh_mapcache = MAP_DOM_MEM_CACHE_INIT;
+ struct map_dom_mem_cache mapcache, sh_mapcache;
LOCK_BIGLOCK(d);
(void)get_user(done, pdone);
}
+ init_map_domain_mem_cache(&mapcache);
+ init_map_domain_mem_cache(&sh_mapcache);
+
if ( !set_foreigndom(cpu, foreigndom) )
{
rc = -EINVAL;
}
out:
- unmap_domain_mem_cache(&mapcache);
- unmap_domain_mem_cache(&sh_mapcache);
+ destroy_map_domain_mem_cache(&mapcache);
+ destroy_map_domain_mem_cache(&sh_mapcache);
process_deferred_ops(cpu);
* Read the physical hardware table. Anything here will
* override the defaults.
*/
- if (!smp_read_mpc((void *)mpf->mpf_physptr)) {
+ if (!smp_read_mpc((void *)(unsigned long)mpf->mpf_physptr)) {
smp_found_config = 0;
printk(KERN_ERR "BIOS bug, MP table errors detected!...\n");
printk(KERN_ERR "... disabling SMP support. (tell your hw vendor)\n");
struct pfn_info *page, *l2page;
l2_pgentry_t *l2;
unsigned long mfn, pfn;
- struct map_dom_mem_cache l2cache = MAP_DOM_MEM_CACHE_INIT;
- struct map_dom_mem_cache l1cache = MAP_DOM_MEM_CACHE_INIT;
+ struct map_dom_mem_cache l1cache, l2cache;
l2page = alloc_domheap_page(NULL);
- if ( !l2page )
+ if ( l2page == NULL )
return 0;
+
+ init_map_domain_mem_cache(&l1cache);
+ init_map_domain_mem_cache(&l2cache);
+
d->arch.phys_table = mk_pagetable(page_to_phys(l2page));
l2 = map_domain_mem_with_cache(page_to_phys(l2page), &l2cache);
memset(l2, 0, PAGE_SIZE);
list_ent = page->list.next;
}
- unmap_domain_mem_cache(&l2cache);
- unmap_domain_mem_cache(&l1cache);
+ destroy_map_domain_mem_cache(&l2cache);
+ destroy_map_domain_mem_cache(&l1cache);
return 1;
}
-/*******************************************************************************
+/******************************************************************************
* Simple EDF scheduler for xen
*
* by Stephan Diestelhorst (C) 2004 Cambridge University
struct sedf_edom_info *curinf;
ASSERT(!extraq_on(d,i));
- PRINT(3, "Adding domain %i.%i (score= %i, short_pen= %lli) to L%i "\
- "extraq\n", d->domain->id, d->id, EDOM_INFO(d)->score[i],
- EDOM_INFO(d)->short_block_lost_tot, i);
+ PRINT(3, "Adding domain %i.%i (score= %i, short_pen= %"PRIi64")"
+ " to L%i extraq\n",
+ d->domain->id, d->id, EDOM_INFO(d)->score[i],
+ EDOM_INFO(d)->short_block_lost_tot, i);
/*iterate through all elements to find our "hole" and on our way
update all the other scores*/
list_for_each(cur,EXTRAQ(d->processor,i)){
{
struct list_head *list = LIST(d);
ASSERT(__task_on_queue(d));
- PRINT(3,"Removing domain %i.%i (bop= %llu) from runq/waitq\n", d->domain->id,
- d->id, PERIOD_BEGIN(EDOM_INFO(d)));
+ PRINT(3,"Removing domain %i.%i (bop= %"PRIu64") from runq/waitq\n",
+ d->domain->id, d->id, PERIOD_BEGIN(EDOM_INFO(d)));
list_del(list);
list->next = NULL;
ASSERT(!__task_on_queue(d));
DOMAIN_COMPARER(waitq, list, PERIOD_BEGIN(d1), PERIOD_BEGIN(d2))
static inline void __add_to_waitqueue_sort(struct exec_domain *d) {
ASSERT(!__task_on_queue(d));
- PRINT(3,"Adding domain %i.%i (bop= %llu) to waitq\n", d->domain->id,
- d->id, PERIOD_BEGIN(EDOM_INFO(d)));
+ PRINT(3,"Adding domain %i.%i (bop= %"PRIu64") to waitq\n",
+ d->domain->id, d->id, PERIOD_BEGIN(EDOM_INFO(d)));
list_insert_sort(WAITQ(d->processor), LIST(d), waitq_comp);
ASSERT(__task_on_queue(d));
}
*/
DOMAIN_COMPARER(runq, list, d1->deadl_abs, d2->deadl_abs)
static inline void __add_to_runqueue_sort(struct exec_domain *d) {
- PRINT(3,"Adding domain %i.%i (deadl= %llu) to runq\n", d->domain->id,
- d->id, EDOM_INFO(d)->deadl_abs);
+ PRINT(3,"Adding domain %i.%i (deadl= %"PRIu64") to runq\n",
+ d->domain->id, d->id, EDOM_INFO(d)->deadl_abs);
list_insert_sort(RUNQ(d->processor), LIST(d), runq_comp);
}
/*we missed the deadline or the slice was
already finished... might hapen because
of dom_adj.*/
- PRINT(4,"\tDomain %i.%i exceeded it's deadline/"\
- "slice (%llu / %llu) now: %llu "\
- "cputime: %llu\n",
+ PRINT(4,"\tDomain %i.%i exceeded it's deadline/"
+ "slice (%"PRIu64" / %"PRIu64") now: %"PRIu64
+ " cputime: %"PRIu64"\n",
curinf->exec_domain->domain->id,
curinf->exec_domain->id,
curinf->deadl_abs, curinf->slice, now,
/*reduce block lost, probably more sophistication here!*/
/*inf->short_block_lost_tot -= EXTRA_QUANTUM;*/
inf->short_block_lost_tot -= now - inf->sched_start_abs;
- PRINT(3,"Domain %i.%i: Short_block_loss: %lli\n",
+ PRINT(3,"Domain %i.%i: Short_block_loss: %"PRIi64"\n",
inf->exec_domain->domain->id, inf->exec_domain->id,
inf->short_block_lost_tot);
if (inf->short_block_lost_tot <= 0) {
/*TODO: Do something USEFUL when this happens and find out, why it
still can happen!!!*/
if (ret.time<0) {
- printk("Ouch! We are seriously BEHIND schedule! %lli\n",
+ printk("Ouch! We are seriously BEHIND schedule! %"PRIi64"\n",
ret.time);
ret.time = EXTRA_QUANTUM;
}
/*initial setup of the deadline*/
inf->deadl_abs = now + inf->slice;
- PRINT(3,"waking up domain %i.%i (deadl= %llu period= %llu "\
- "now= %llu)\n", d->domain->id, d->id, inf->deadl_abs,
+ PRINT(3,"waking up domain %i.%i (deadl= %"PRIu64" period= %"PRIu64" "\
+ "now= %"PRIu64")\n", d->domain->id, d->id, inf->deadl_abs,
inf->period, now);
#ifdef SEDF_STATS
inf->block_tot++;
extraq_check_add_unblocked(d, 1);
}
}
- PRINT(3,"woke up domain %i.%i (deadl= %llu period= %llu "\
- "now= %llu)\n", d->domain->id, d->id, inf->deadl_abs,
+ PRINT(3,"woke up domain %i.%i (deadl= %"PRIu64" period= %"PRIu64" "\
+ "now= %"PRIu64")\n", d->domain->id, d->id, inf->deadl_abs,
inf->period, now);
if (PERIOD_BEGIN(inf) > now) {
__add_to_waitqueue_sort(d);
static void sedf_dump_domain(struct exec_domain *d) {
printk("%i.%i has=%c ", d->domain->id, d->id,
test_bit(EDF_RUNNING, &d->flags) ? 'T':'F');
- printk("p=%llu sl=%llu ddl=%llu w=%hu c=%llu sc=%i xtr(%s)=%llu ew=%hu",
+ printk("p=%"PRIu64" sl=%"PRIu64" ddl=%"PRIu64" w=%hu c=%"PRIu64" sc=%i xtr(%s)=%"PRIu64" ew=%hu",
EDOM_INFO(d)->period, EDOM_INFO(d)->slice, EDOM_INFO(d)->deadl_abs,
EDOM_INFO(d)->weight, d->cpu_time, EDOM_INFO(d)->score[EXTRA_UTIL_Q],
(EDOM_INFO(d)->status & EXTRA_AWARE) ? "yes" : "no",
EDOM_INFO(d)->extra_time_tot, EDOM_INFO(d)->extraweight);
if (d->cpu_time !=0)
- printf(" (%llu%%)", (EDOM_INFO(d)->extra_time_tot * 100)
+ printf(" (%"PRIu64"%%)", (EDOM_INFO(d)->extra_time_tot * 100)
/ d->cpu_time);
#ifdef SEDF_STATS
if (EDOM_INFO(d)->block_time_tot!=0)
- printf(" pen=%llu%%", (EDOM_INFO(d)->penalty_time_tot * 100) /
+ printf(" pen=%"PRIu64"%%", (EDOM_INFO(d)->penalty_time_tot * 100) /
EDOM_INFO(d)->block_time_tot);
if (EDOM_INFO(d)->block_tot!=0)
printf("\n blks=%u sh=%u (%u%%) (shc=%u (%u%%) shex=%i "\
- "shexsl=%i) l=%u (%u%%) avg: b=%llu p=%llu",
+ "shexsl=%i) l=%u (%u%%) avg: b=%"PRIu64" p=%"PRIu64"",
EDOM_INFO(d)->block_tot, EDOM_INFO(d)->short_block_tot,
(EDOM_INFO(d)->short_block_tot * 100)
/ EDOM_INFO(d)->block_tot, EDOM_INFO(d)->short_cont,
struct exec_domain *ed;
int loop = 0;
- printk("now=%llu\n",NOW());
+ printk("now=%"PRIu64"\n",NOW());
queue = RUNQ(i);
printk("RUNQ rq %lx n: %lx, p: %lx\n", (unsigned long)queue,
(unsigned long) queue->next, (unsigned long) queue->prev);
static int sedf_adjdom(struct domain *p, struct sched_adjdom_cmd *cmd) {
struct exec_domain *ed;
- PRINT(2,"sedf_adjdom was called, domain-id %i new period %llu "\
- "new slice %llu\nlatency %llu extra:%s\n",
+ PRINT(2,"sedf_adjdom was called, domain-id %i new period %"PRIu64" "\
+ "new slice %"PRIu64"\nlatency %"PRIu64" extra:%s\n",
p->id, cmd->u.sedf.period, cmd->u.sedf.slice,
cmd->u.sedf.latency, (cmd->u.sedf.extratime)?"yes":"no");
if ( cmd->direction == SCHED_INFO_PUT )
* The Hamming Weight of a number is the total number of bits set in it.
*/
+#define hweight64(x) generic_hweight64(x)
#define hweight32(x) generic_hweight32(x)
#define hweight16(x) generic_hweight16(x)
#define hweight8(x) generic_hweight8(x)
#define MAP_DOM_MEM_CACHE_INIT { .pa = 0 }
+static inline void
+init_map_domain_mem_cache(struct map_dom_mem_cache *cache)
+{
+ ASSERT(cache != NULL);
+ *cache = MAP_DOM_MEM_CACHE_INIT;
+}
+
static inline void *
-map_domain_mem_with_cache(unsigned long pa,
- struct map_dom_mem_cache *cache)
+map_domain_mem_with_cache(unsigned long pa, struct map_dom_mem_cache *cache)
{
- if ( likely(cache != NULL) )
+ ASSERT(cache != NULL);
+
+ if ( likely(cache->pa) )
{
- if ( likely(cache->pa) )
- {
- if ( likely((pa & PAGE_MASK) == (cache->pa & PAGE_MASK)) )
- goto done;
- unmap_domain_mem(cache->va);
- }
- cache->pa = (pa & PAGE_MASK) | 1;
- cache->va = map_domain_mem(cache->pa);
- done:
- return (void *)(((unsigned long)cache->va & PAGE_MASK) |
- (pa & ~PAGE_MASK));
+ if ( likely((pa & PAGE_MASK) == (cache->pa & PAGE_MASK)) )
+ goto done;
+ unmap_domain_mem(cache->va);
}
- return map_domain_mem(pa);
+ cache->pa = (pa & PAGE_MASK) | 1;
+ cache->va = map_domain_mem(cache->pa);
+
+ done:
+ return (void *)(((unsigned long)cache->va & PAGE_MASK) |
+ (pa & ~PAGE_MASK));
}
static inline void
-unmap_domain_mem_with_cache(void *va,
- struct map_dom_mem_cache *cache)
+unmap_domain_mem_with_cache(void *va, struct map_dom_mem_cache *cache)
{
- if ( unlikely(!cache) )
- unmap_domain_mem(va);
+ ASSERT(cache != NULL);
+ unmap_domain_mem(va);
}
static inline void
-unmap_domain_mem_cache(struct map_dom_mem_cache *cache)
+destroy_map_domain_mem_cache(struct map_dom_mem_cache *cache)
{
- if ( likely(cache != NULL) && likely(cache->pa) )
+ ASSERT(cache != NULL);
+ if ( likely(cache->pa) )
{
unmap_domain_mem(cache->va);
cache->pa = 0;
#define map_domain_mem(_pa) phys_to_virt(_pa)
#define unmap_domain_mem(_va) ((void)(_va))
+struct map_dom_mem_cache {
+};
+
+#define init_map_domain_mem_cache(_c) ((void)(_c))
+#define map_domain_mem_with_cache(_p,_c) (map_domain_mem(_p))
+#define unmap_domain_mem_with_cache(_v,_c) ((void)(_v))
+#define destroy_map_domain_mem_cache(_c) ((void)(_c))
+
#endif /* __ASM_DOMAIN_PAGE_H__ */
--- /dev/null
+/* Copyright (C) 1997-2001, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99: 7.8 Format conversion of integer types <inttypes.h>
+ */
+
+#ifndef _XEN_INTTYPES_H
+#define _XEN_INTTYPES_H 1
+
+#include <xen/config.h>
+#include <xen/types.h>
+
+# if BITS_PER_LONG == 64
+# define __PRI64_PREFIX "l"
+# define __PRIPTR_PREFIX "l"
+# else
+# define __PRI64_PREFIX "ll"
+# define __PRIPTR_PREFIX
+# endif
+
+/* Macros for printing format specifiers. */
+
+/* Decimal notation. */
+# define PRId8 "d"
+# define PRId16 "d"
+# define PRId32 "d"
+# define PRId64 __PRI64_PREFIX "d"
+
+# define PRIdLEAST8 "d"
+# define PRIdLEAST16 "d"
+# define PRIdLEAST32 "d"
+# define PRIdLEAST64 __PRI64_PREFIX "d"
+
+# define PRIdFAST8 "d"
+# define PRIdFAST16 __PRIPTR_PREFIX "d"
+# define PRIdFAST32 __PRIPTR_PREFIX "d"
+# define PRIdFAST64 __PRI64_PREFIX "d"
+
+
+# define PRIi8 "i"
+# define PRIi16 "i"
+# define PRIi32 "i"
+# define PRIi64 __PRI64_PREFIX "i"
+
+# define PRIiLEAST8 "i"
+# define PRIiLEAST16 "i"
+# define PRIiLEAST32 "i"
+# define PRIiLEAST64 __PRI64_PREFIX "i"
+
+# define PRIiFAST8 "i"
+# define PRIiFAST16 __PRIPTR_PREFIX "i"
+# define PRIiFAST32 __PRIPTR_PREFIX "i"
+# define PRIiFAST64 __PRI64_PREFIX "i"
+
+/* Octal notation. */
+# define PRIo8 "o"
+# define PRIo16 "o"
+# define PRIo32 "o"
+# define PRIo64 __PRI64_PREFIX "o"
+
+# define PRIoLEAST8 "o"
+# define PRIoLEAST16 "o"
+# define PRIoLEAST32 "o"
+# define PRIoLEAST64 __PRI64_PREFIX "o"
+
+# define PRIoFAST8 "o"
+# define PRIoFAST16 __PRIPTR_PREFIX "o"
+# define PRIoFAST32 __PRIPTR_PREFIX "o"
+# define PRIoFAST64 __PRI64_PREFIX "o"
+
+/* Unsigned integers. */
+# define PRIu8 "u"
+# define PRIu16 "u"
+# define PRIu32 "u"
+# define PRIu64 __PRI64_PREFIX "u"
+
+# define PRIuLEAST8 "u"
+# define PRIuLEAST16 "u"
+# define PRIuLEAST32 "u"
+# define PRIuLEAST64 __PRI64_PREFIX "u"
+
+# define PRIuFAST8 "u"
+# define PRIuFAST16 __PRIPTR_PREFIX "u"
+# define PRIuFAST32 __PRIPTR_PREFIX "u"
+# define PRIuFAST64 __PRI64_PREFIX "u"
+
+/* lowercase hexadecimal notation. */
+# define PRIx8 "x"
+# define PRIx16 "x"
+# define PRIx32 "x"
+# define PRIx64 __PRI64_PREFIX "x"
+
+# define PRIxLEAST8 "x"
+# define PRIxLEAST16 "x"
+# define PRIxLEAST32 "x"
+# define PRIxLEAST64 __PRI64_PREFIX "x"
+
+# define PRIxFAST8 "x"
+# define PRIxFAST16 __PRIPTR_PREFIX "x"
+# define PRIxFAST32 __PRIPTR_PREFIX "x"
+# define PRIxFAST64 __PRI64_PREFIX "x"
+
+/* UPPERCASE hexadecimal notation. */
+# define PRIX8 "X"
+# define PRIX16 "X"
+# define PRIX32 "X"
+# define PRIX64 __PRI64_PREFIX "X"
+
+# define PRIXLEAST8 "X"
+# define PRIXLEAST16 "X"
+# define PRIXLEAST32 "X"
+# define PRIXLEAST64 __PRI64_PREFIX "X"
+
+# define PRIXFAST8 "X"
+# define PRIXFAST16 __PRIPTR_PREFIX "X"
+# define PRIXFAST32 __PRIPTR_PREFIX "X"
+# define PRIXFAST64 __PRI64_PREFIX "X"
+
+
+/* Macros for printing `intmax_t' and `uintmax_t'. */
+# define PRIdMAX __PRI64_PREFIX "d"
+# define PRIiMAX __PRI64_PREFIX "i"
+# define PRIoMAX __PRI64_PREFIX "o"
+# define PRIuMAX __PRI64_PREFIX "u"
+# define PRIxMAX __PRI64_PREFIX "x"
+# define PRIXMAX __PRI64_PREFIX "X"
+
+
+/* Macros for printing `intptr_t' and `uintptr_t'. */
+# define PRIdPTR __PRIPTR_PREFIX "d"
+# define PRIiPTR __PRIPTR_PREFIX "i"
+# define PRIoPTR __PRIPTR_PREFIX "o"
+# define PRIuPTR __PRIPTR_PREFIX "u"
+# define PRIxPTR __PRIPTR_PREFIX "x"
+# define PRIXPTR __PRIPTR_PREFIX "X"
+
+
+/* Macros for scanning format specifiers. */
+
+/* Signed decimal notation. */
+# define SCNd8 "hhd"
+# define SCNd16 "hd"
+# define SCNd32 "d"
+# define SCNd64 __PRI64_PREFIX "d"
+
+# define SCNdLEAST8 "hhd"
+# define SCNdLEAST16 "hd"
+# define SCNdLEAST32 "d"
+# define SCNdLEAST64 __PRI64_PREFIX "d"
+
+# define SCNdFAST8 "hhd"
+# define SCNdFAST16 __PRIPTR_PREFIX "d"
+# define SCNdFAST32 __PRIPTR_PREFIX "d"
+# define SCNdFAST64 __PRI64_PREFIX "d"
+
+/* Signed decimal notation. */
+# define SCNi8 "hhi"
+# define SCNi16 "hi"
+# define SCNi32 "i"
+# define SCNi64 __PRI64_PREFIX "i"
+
+# define SCNiLEAST8 "hhi"
+# define SCNiLEAST16 "hi"
+# define SCNiLEAST32 "i"
+# define SCNiLEAST64 __PRI64_PREFIX "i"
+
+# define SCNiFAST8 "hhi"
+# define SCNiFAST16 __PRIPTR_PREFIX "i"
+# define SCNiFAST32 __PRIPTR_PREFIX "i"
+# define SCNiFAST64 __PRI64_PREFIX "i"
+
+/* Unsigned decimal notation. */
+# define SCNu8 "hhu"
+# define SCNu16 "hu"
+# define SCNu32 "u"
+# define SCNu64 __PRI64_PREFIX "u"
+
+# define SCNuLEAST8 "hhu"
+# define SCNuLEAST16 "hu"
+# define SCNuLEAST32 "u"
+# define SCNuLEAST64 __PRI64_PREFIX "u"
+
+# define SCNuFAST8 "hhu"
+# define SCNuFAST16 __PRIPTR_PREFIX "u"
+# define SCNuFAST32 __PRIPTR_PREFIX "u"
+# define SCNuFAST64 __PRI64_PREFIX "u"
+
+/* Octal notation. */
+# define SCNo8 "hho"
+# define SCNo16 "ho"
+# define SCNo32 "o"
+# define SCNo64 __PRI64_PREFIX "o"
+
+# define SCNoLEAST8 "hho"
+# define SCNoLEAST16 "ho"
+# define SCNoLEAST32 "o"
+# define SCNoLEAST64 __PRI64_PREFIX "o"
+
+# define SCNoFAST8 "hho"
+# define SCNoFAST16 __PRIPTR_PREFIX "o"
+# define SCNoFAST32 __PRIPTR_PREFIX "o"
+# define SCNoFAST64 __PRI64_PREFIX "o"
+
+/* Hexadecimal notation. */
+# define SCNx8 "hhx"
+# define SCNx16 "hx"
+# define SCNx32 "x"
+# define SCNx64 __PRI64_PREFIX "x"
+
+# define SCNxLEAST8 "hhx"
+# define SCNxLEAST16 "hx"
+# define SCNxLEAST32 "x"
+# define SCNxLEAST64 __PRI64_PREFIX "x"
+
+# define SCNxFAST8 "hhx"
+# define SCNxFAST16 __PRIPTR_PREFIX "x"
+# define SCNxFAST32 __PRIPTR_PREFIX "x"
+# define SCNxFAST64 __PRI64_PREFIX "x"
+
+
+/* Macros for scanning `intmax_t' and `uintmax_t'. */
+# define SCNdMAX __PRI64_PREFIX "d"
+# define SCNiMAX __PRI64_PREFIX "i"
+# define SCNoMAX __PRI64_PREFIX "o"
+# define SCNuMAX __PRI64_PREFIX "u"
+# define SCNxMAX __PRI64_PREFIX "x"
+
+/* Macros for scaning `intptr_t' and `uintptr_t'. */
+# define SCNdPTR __PRIPTR_PREFIX "d"
+# define SCNiPTR __PRIPTR_PREFIX "i"
+# define SCNoPTR __PRIPTR_PREFIX "o"
+# define SCNuPTR __PRIPTR_PREFIX "u"
+# define SCNxPTR __PRIPTR_PREFIX "x"
+
+#endif /* _XEN_INTTYPES_H */
#ifndef __LIB_H__
#define __LIB_H__
+#include <xen/inttypes.h>
#include <stdarg.h>
#include <xen/config.h>
#include <xen/types.h>